#ifndef Includes_h
#define Includes_h

#include "Config.h"

///////////////////////////////////////////////////////////////////////commom function
//conditional compile : define moving functions and varibles accordingly

//gyro
#if( Gyro_Sensor_En==1)
void Turn_Center_Gyro(int Aim_Angle,int Max_Speed,int Exit_Time,TTimers Timer_x);
#endif

//move and encoder
#if(RT_Chassis & Mecanum_Cross_Axis_Holo) // Mecanum_Holo

tMotor Mtr_R_F=Mtr_2;
tMotor Mtr_L_F=Mtr_3;
tMotor Mtr_L_B=Mtr_4; //BAD PORT
tMotor Mtr_R_B=Mtr_5;

void Robot_Move( int Vx, int Vy, int Turn, int Move_Only_Highest_Speed, int Turn_highest_speed );

#if(Encoder_Sensor_En==1)
tSensors enc_B_L=enc_2;
tSensors enc_B_R=enc_3;
#if(Gyro_Sensor_En==1)
void Trans_Dist_Gyro_Encoder(int X_Dist_mm,int Y_Dist_mm,int Max_Speed,int Delta_Gyro_Max_Speed,int Exit_Time,TTimers Timer_x);
#endif
#endif

///////////////////////////////////////////////////////////////////////
#elif(RT_Chassis & (Omni_Cross_Axis_Holo | Omni_Parallel_Axis_Holo) )//Omni_Cross_Axis_Holo and Parallel_Axis_Holo

tMotor Mtr_R_F=Mtr_2;
tMotor Mtr_L_F=Mtr_3;
tMotor Mtr_L_B=Mtr_4;
tMotor Mtr_R_B=Mtr_5;

tMotor Mtr_Fx=Mtr_R_F;
tMotor Mtr_Ly=Mtr_L_F;
tMotor Mtr_Bx=Mtr_L_B;
tMotor Mtr_Ry=Mtr_R_B;
void Robot_Move( int Vx, int Vy, int Turn, int Move_Only_Highest_Speed, int Turn_highest_speed );

#if(Encoder_Sensor_En==1)

tSensors enc_4=dgtl5;
tSensors enc_5=dgtl7;

tSensors enc_R_F=enc_2;
tSensors enc_L_F=enc_3;
tSensors enc_L_B=enc_4;
tSensors enc_R_B=enc_5;

tSensors enc_Fx=enc_R_F;
tSensors enc_Ly=enc_L_F;
tSensors enc_Bx=enc_L_B;
tSensors enc_Ry=enc_R_B;

void Trans_Dist_Encoder_TwistedPID_P(int Dist_mm_X,int Dist_mm_Y,int Max_Speed,int Delta_Max_Speed,int Exit_Time,TTimers Timer_x);
void Trans_Dist_Encoder_TwistedPID_Q(int Dist_mm_X,int Dist_mm_Y,int Max_Speed,int Delta_Max_Speed,int Exit_Time,TTimers Timer_x);
#endif

///////////////////////////////////////////////////////////////////////
#elif(RT_Chassis & Omni_Parallel_Axis_Arcade )  //Omni parallel Arcade

tMotor Mtr_R_F=Mtr_2;
tMotor Mtr_L_F=Mtr_3;
tMotor Mtr_L_B=Mtr_4;
tMotor Mtr_R_B=Mtr_5;
void Robot_Move(int Vy, int Turn, int Move_Only_Highest_Speed, int Turn_Highest_speed );

#if(Encoder_Sensor_En==1)
tSensors enc_R=enc_2;
tSensors enc_L=enc_3;
void Forward_Dist_TwistedPID(int Dist_mm,int Max_Speed,int Delta_Max_Speed,int Exit_Time,TTimers Timer_x);
#endif

///////////////////////////////////////////////////////////////////////
#else
#error "SB,You haven't defined RT_Chassis type !!!!"
#endif

/////////////////////////////////////////

#define Blue_Field -1
#define Red_Field   1

#define RT_Section 1
#define RT_Cube    0


int ROLE=RT_Section;
int FIELD=Blue_Field;
tSensors LED=led_Blue;
bool Cylinder_Hook_State_Lock=true;

TSemaphore sem_Rise_Updown;
TSemaphore sem_Turning_Arm;

#include "LIB_Robot_Move.c"
#include "LIB_Turn_Center_Gyro.c"

#include "_User_Turning_Arm.c"
#include "_User_Rise_UpDown.c"
#include "_User_Cylinder_Claw.c"
#include "_User_Cylinder_Hook.c"
#include "_LIB_Forward_Dist_BSonar_Gyro.c"

#include "_User_Task_Def.c"
#include "_User_Section.c"


#include "_LIB_Field.c"
#include "_LIB_Role.c"


#include "LIB_Init_All.c"
#include "_LIB_Pre_Auto.c"
#include "LIB_ManualHandle.c"

#include "LIB_AutoRoute_Cube.c"
#include "LIB_AutoRoute_Section.c"
#include "LIB_AutoRoute.c"

/////////////////////////////////////////
#endif
